package com.enlf.config;

import org.redisson.Redisson;

import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * _*_ coding : utf-8 _*_
 *
 * @Time : 2023/10/2 19:55
 * @Author : 计201任思伟
 * @File : RedissionConfig
 * @Project : enjoy-life
 */
@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        //集群模式下使用这个配置config.useClusterServers()\
        config.useSingleServer().setAddress("redis://127.0.0.1:6379");
        return Redisson.create(config);
    }

  /*  @Bean
    public RedissonClient redissonClient1(){
        Config config = new Config();
        //集群模式下使用这个配置config.useClusterServers()\
        config.useSingleServer().setAddress("redis://192.168.10.66:6380");
        return Redisson.create(config);
    }

    @Bean
    public RedissonClient redissonClient2(){
        Config config = new Config();
        //集群模式下使用这个配置config.useClusterServers()\
        config.useSingleServer().setAddress("redis://192.168.10.66:6381");
        return Redisson.create(config);
    }*/

}

